package com.heer.gymnasium.module.evaluate.beans;

import com.heer.gymnasium.base.BaseBean;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by yan
 * on 2018/3/15
 */

public class MemberItemBean extends BaseBean {
    private String id;
    private String headUrl;
    private String memberName;
    private boolean isEval;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getHeadUrl() {
        return headUrl;
    }

    public void setHeadUrl(String headUrl) {
        this.headUrl = headUrl;
    }

    public String getMemberName() {
        return memberName;
    }

    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }

    public boolean isEval() {
        return isEval;
    }

    public void setEval(boolean eval) {
        isEval = eval;
    }


    public static List<MemberItemBean> dataChange(List<MemberListResponseBean.Item> itemList) {
        List<MemberItemBean> beanList = new ArrayList<>();
        if (itemList != null) {
            for (int i = 0; i < itemList.size(); i++) {
                MemberListResponseBean.Item item = itemList.get(i);
                MemberItemBean bean = new MemberItemBean();
                bean.setId(item.getId() + "");
                bean.setMemberName(item.getNickname());
                bean.setHeadUrl(item.getAvatar());
                if (item.getIs_eval().equals("1")) {
                    bean.setEval(true);
                } else {
                    bean.setEval(false);
                }
                beanList.add(bean);
            }
        }
        return beanList;
    }
}
